<?php
	class Uploader{
		var $uploadFile;
		var $dir;
		
		function Uploader($fichier,$dossier){
			$this->uploadFile = $fichier;
			$this->dir = $dossier;
		}
		
		function upload(){
			if(!isset($this->uploadFile['tmp_name'])){ //Savoir si c'est un tableau ou un fichier unique
				foreach($this->uploadFile as $key => $value){
					if(!move_uploaded_file($this->uploadFile[$key]['tmp_name'], $this->dir)) return false;
				}
				return true;
			}
			else
			{
				return move_uploaded_file($this->uploadFile['tmp_name'], $this->dir);
			}
		}
	}
?>